package com.ruoyi.project.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mapper.ProTodoMapper;
import com.ruoyi.project.domain.ProTodo;
import com.ruoyi.project.service.IProTodoService;

/**
 * 待办事项Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-06
 */
@Service
public class ProTodoServiceImpl implements IProTodoService 
{
    @Autowired
    private ProTodoMapper proTodoMapper;

    /**
     * 查询待办事项
     * 
     * @param todoId 待办事项主键
     * @return 待办事项
     */
    @Override
    public ProTodo selectProTodoByTodoId(Long todoId)
    {
        return proTodoMapper.selectProTodoByTodoId(todoId);
    }

    /**
     * 查询待办事项列表
     * 
     * @param proTodo 待办事项
     * @return 待办事项
     */
    @Override
    public List<ProTodo> selectProTodoList(ProTodo proTodo)
    {
        return proTodoMapper.selectProTodoList(proTodo);
    }

    /**
     * 新增待办事项
     * 
     * @param proTodo 待办事项
     * @return 结果
     */
    @Override
    public int insertProTodo(ProTodo proTodo)
    {
        proTodo.setCreateTime(DateUtils.getNowDate());
        return proTodoMapper.insertProTodo(proTodo);
    }

    /**
     * 修改待办事项
     * 
     * @param proTodo 待办事项
     * @return 结果
     */
    @Override
    public int updateProTodo(ProTodo proTodo)
    {
        proTodo.setUpdateTime(DateUtils.getNowDate());
        return proTodoMapper.updateProTodo(proTodo);
    }

    /**
     * 批量删除待办事项
     * 
     * @param todoIds 需要删除的待办事项主键
     * @return 结果
     */
    @Override
    public int deleteProTodoByTodoIds(Long[] todoIds)
    {
        return proTodoMapper.deleteProTodoByTodoIds(todoIds);
    }

    /**
     * 删除待办事项信息
     * 
     * @param todoId 待办事项主键
     * @return 结果
     */
    @Override
    public int deleteProTodoByTodoId(Long todoId)
    {
        return proTodoMapper.deleteProTodoByTodoId(todoId);
    }
}
